From 66041d1b9c3a82c43d3c8f10cfd4247a7a876684 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 5 Oct 2005 19:15:56 +0100 Subject: [PATCH] Gentoo compatible stuff has to be done *before* the set -e. You could also do the which in the if with a combination of ! and || after the set -e but I think it's cleaner to just do it before the set -e. Signed-off-by: Anthony Liguori --- tools/examples/network-bridge | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/tools/examples/network-bridge b/tools/examples/network-bridge index f862db0c3f..f0e1e1648d 100755 --- a/tools/examples/network-bridge +++ b/tools/examples/network-bridge @@ -39,6 +39,17 @@ # #============================================================================ +# Gentoo doesn't have ifup/ifdown: define appropriate alternatives +which ifup >& /dev/null +if [ "$?" != 0 -a -e /etc/conf.d/net ]; then + ifup() { + /etc/init.d/net.$1 start + } + ifdown() { + /etc/init.d/net.$1 stop + } +fi + # Exit if anything goes wrong. set -e @@ -55,17 +66,6 @@ antispoof=${antispoof:-no} echo "*network $OP bridge=$bridge netdev=$netdev antispoof=$antispoof" >&2 -# Gentoo doesn't have ifup/ifdown: define appropriate alternatives -which ifup >& /dev/null -if [ "$?" != 0 -a -e /etc/conf.d/net ]; then - ifup() { - /etc/init.d/net.$1 start - } - ifdown() { - /etc/init.d/net.$1 stop - } -fi - # Usage: transfer_addrs src dst # Copy all IP addresses (including aliases) from device $src to device $dst. transfer_addrs () { -- 2.30.2